import {observable,action,computed} from "mobx";
import {axios} from "&/axios"

class Data{
    @observable homedata=null;
    @observable userlist=null;
    @observable tiwenlist=null;
    @observable goodslist=null;
    @observable typelist = null;
    @observable adviselist=null;
    @observable outinlist=null;

    @action getOutinList(payload){
        this.outinlist=payload
    }
    
    

    @action setOutinList(){
        axios.post("/api/findoutinlist").then(res=>{
            if(res.data.type){
                this.outinlist=res.data.result
            }
        })
    }

    @action getHomedata(url){
        axios.get(url).then(res=>{
            this.homedata=res.data.result;
        })
    }
    @action getUserlist(url){
        axios.post(url).then(res=>{
            this.userlist=res.data.result
        })
    }
    @action getUserlistSync(payload){
        this.userlist = [...payload]
    }
    @action getTiWenListSync(payload){
        this.tiwenlist=payload
    }
    @action getGoodsListSync(payload){
        this.goodslist=payload
    }
    @action getTypeListSync(payload){
        this.typelist=payload
    }
    @action  getAdviseListSync(payload){
        this.adviselist=payload
    }

}
export default new Data();